﻿using Aquarinum.Base.Infrastructure.Ioc;
using Aquarinum.Base.Infrastructure.WebSocket.Interface;
using Aquarinum.Base.Infrastructure.WebSocket.InterfaceImp;
using Aquarinum.WebSocekt.Core.Dtos;

namespace Aquarinum.Base.Infrastructure.WebSocket.MessageHandler
{
    public class MessageHandleStrategyBase : IMessageHandleStrategy
    {
        protected readonly IMessageSendProxy MessageSendProxy;

        /// <summary>
        ///     连接容器
        /// </summary>
        protected readonly WebSocketConnectionContainer WebSocketConnectionContainer;

        public MessageHandleStrategyBase()
        {
            MessageSendProxy = AquainumContainer.Resolve<IMessageSendProxy>();
            WebSocketConnectionContainer = AquainumContainer.Resolve<WebSocketConnectionContainer>();
        }

        public MessageHandleStrategyBase(WebSocketConnectionContainer webSocketConnectionContainer,
            IMessageSendProxy messageSendProxy)
        {
            WebSocketConnectionContainer = webSocketConnectionContainer;
            MessageSendProxy = messageSendProxy;
        }

        public virtual void HandleMessage(WebsocketMessageDto message)
        {
        }
    }
}